﻿@model IEnumerable<GameSchool.Models.Course>

@{
    ViewBag.Title = "Námskeiðin mín";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Námskeiðin mín</h2>

<p>
    @Html.ActionLink("Búa til nýtt námskeið", "CreateCourse", "Course", new { id = Model.Last().CourseId +1 }, null)
</p>
<table>
    <tr>
        <th>
            CourseName
        </th>
        <th>
            Description
        </th>
		<th>
		</th>
		<th>
		</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CourseName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
		
	    <td>
		    @Html.ActionLink("Breyta", "EditCourse", "Course", new { id = item.CourseId }, null)
	    </td>
        <td>
            @Html.ActionLink("Um námskeið", "DetailsCourse", "Course", new { id = item.CourseId }, null)
        </td>
    </tr>
}
</table>
